<template>
  <div class="app-container">
    <h4>{{$t('基本信息')}}</h4>

    <div class="table-layout" align="center">
      <el-row>
        <el-col :span="6" class="table-cell-name">{{$t('Shop_check_no')}}</el-col>
        <el-col :span="18" align="left" class="table-cell-content">
          {{checkData.check.checkNo}}
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="6" class="table-cell-name">{{$t('Shop_check_user')}}</el-col>
        <el-col :span="18" align="left" class="table-cell-content">
          {{checkData.check.checkUserName}}
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="6" class="table-cell-name">{{$t('Shop_check_time')}}</el-col>
        <el-col :span="18" align="left" class="table-cell-content">
          {{checkData.check.checkTime}}
        </el-col>
      </el-row>
    </div>

    <h4>{{$t('详情')}}</h4>

    <el-table :data="checkData.checkItems" style="width: 100%">
      <el-table-column prop="merchandiseSn" :label="$t('Merchandise_number')"></el-table-column>
      <el-table-column prop="name" :label="$t('Merchandise_name')"></el-table-column>
      <el-table-column align="center" :label="$t('Specifications')" prop="standard"/>
      <el-table-column align="center" :label="$t('Model')" prop="model"/>
      <el-table-column prop="systemSurplusNumber" :label="$t('系统剩余库存')">
        <template slot-scope="scope">
          {{scope.row.systemSurplusNumber + "(" + scope.row.checkUnit + ")"}}
        </template>
      </el-table-column>
      <el-table-column prop="checkNumber" :label="$t('盘点库存')">
        <template slot-scope="scope">
          {{scope.row.checkNumber + "(" + scope.row.checkUnit + ")"}}
        </template>
      </el-table-column>
      <el-table-column prop="lossNumber" :label="$t('盘盈')">
        <template slot-scope="scope">
          {{scope.row.lossNumber + "(" + scope.row.checkUnit + ")"}}
        </template>
      </el-table-column>
      <el-table-column prop="remark" :label="$t('备注')"></el-table-column>
    </el-table>
  </div>
</template>

<script>
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
import { shopCheckDetail} from '@/api/shop'
import { MessageBox } from 'element-ui'

export default {
  name: 'shopCheckDetail',
  components: { Pagination },
  data() {
    return {
      checkData: {

      }
    }
  },
  created() {
    if (this.$route.query.shopId) {
      this.listQuery.shopId = this.$route.query.shopId
    }
    this.initData()
  },
  methods: {
    initData() {
      const shopCheckId = this.$route.query.id
      shopCheckDetail(shopCheckId).then(res => {
        this.checkData = res.data.data
      })
    }
  }
}
</script>

<style scoped>
  .table-layout {
    margin-top: 20px;
    border-left: 1px solid #DCDFE6;
    border-top: 1px solid #DCDFE6;
  }

  .table-cell {
    height: 60px;
    line-height: 40px;
    border-right: 1px solid #DCDFE6;
    border-bottom: 1px solid #DCDFE6;
    padding: 10px;
    font-size: 14px;
    color: #606266;
    text-align: center;
    overflow: hidden;
  }

  .table-cell-title {
    border-right: 1px solid #DCDFE6;
    border-bottom: 1px solid #DCDFE6;
    padding: 10px;
    background: #F2F6FC;
    text-align: center;
    font-size: 14px;
    color: #303133;
  }

  .table-cell-name {
    border-right: 1px solid #DCDFE6;
    border-bottom: 1px solid #DCDFE6;
    padding: 10px;
    background: #F2F6FC;
    font-size: 14px;
    color: #303133;
  }
  .table-cell-content {
    border-right: 1px solid #DCDFE6;
    border-bottom: 1px solid #DCDFE6;
    padding: 10px;
    font-size: 14px;
    color: #303133;
  }
</style>
